package com.PeidongYunxuan.sensorsdetector;

import com.PeidongYunxuan.sensorsdetector.adapter.DateTime;
import com.PeidongYunxuan.sensorsdetector.adapter.Mail;
import com.PeidongYunxuan.sensorsdetector.adapter.SendFile;
import com.PeidongYunxuan.sensorsdetector.database.FileInOut;
import com.PeidongYunxuan.sensorsdetector.database.XZip;
import com.PeidongYunxuan.sensorsdetector.service.SensorService;
import com.PeidongYunxuan.sensorsdetector.service.SensorService.SensorBinder;

import android.app.Activity;
import android.content.BroadcastReceiver;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.ServiceConnection;
import android.graphics.LightingColorFilter;
import android.net.Uri;
import android.os.Bundle;
import android.os.IBinder;
import android.os.StrictMode;
import android.text.StaticLayout;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class PeidongTestActivity extends Activity implements OnClickListener {
	public static boolean mCanSendMail = true;
	private Button startService;

	private Button stopService;

	private Button bindService;

	private Button unbindService;

	private SensorService.SensorBinder mBinder;
//	private ServiceConnection connection = new ServiceConnection() {
//
//		@Override
//		public void onServiceConnected(ComponentName name, IBinder service) {
//			mBinder = (SensorService.SensorBinder) service;
//			mBinder.startDownload();
//		}
//
//		@Override
//		public void onServiceDisconnected(ComponentName name) {
//		}
//
//	};

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_service);

//		if (android.os.Build.VERSION.SDK_INT > 9) {
//			StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll()
//					.build();
//			StrictMode.setThreadPolicy(policy);
//		}
		

		Intent startIntent = new Intent(this, SensorService.class);
		startService(startIntent);
		
//		Intent bindIntent = new Intent(this, SensorService.class);  
//        bindService(bindIntent, connection, BIND_AUTO_CREATE);  
		startService = (Button) findViewById(R.id.start_service);
		stopService = (Button) findViewById(R.id.stop_service);
		startService.setOnClickListener(this);
		stopService.setOnClickListener(this);
	}

	@Override
	public void onClick(View v) {
		}
	}
